import React from "react"
import MainTitle from "../main_title/main_title"
import {Link} from "react-router-dom"
import axios from "axios"

import "./main.scss"



class Main extends React.Component{
    constructor(props){
        super(props)
        this.state={
            userCount       : '-',
            productCount    : '-',
            orderCount      : '-'
        }
    }
    componentDidMount(){
    
    // axios.get("/manage/statistic/base_count.do").then(res=>{
    //    this.setState({
    //        userCount:res.data.data.userCount,
    //        productCount:res.data.data.productCount,
    //        orderCount:res.data.data.orderCount
    //    })
    // })
    //     console.log(this.state)
    }
    
    render(){
        return(
            <div id="page-wrapper">
                <MainTitle title="首页"/>
                <div className="row">
                    <div className="col-md-4">
                        <Link to="/user" className="color-box brown">
                            <p className="count">{this.state.userCount}</p>
                            <p className="desc">
                                <i className="fa fa-user-o"></i>
                                <span>用户总数</span>
                            </p>
                        </Link>
                    </div>
                    <div className="col-md-4">
                    <Link to="/user" className="color-box green">
                        <p className="count">{this.state.productCount}</p>
                        <p className="desc">
                            <i className="fa fa-list"></i>
                            <span>商品总数</span>
                        </p>
                    </Link>
                </div>
            
            
                <div className="col-md-4">
                    <Link to="/user" className="color-box blue">
                        <p className="count">{this.state.orderCount}</p>
                        <p className="desc">
                            <i className="fa fa-check-square-o"></i>
                            <span>订单总数</span>
                        </p>
                    </Link>
                </div>
                </div>
                
                   
                
            </div>
        )
    }
}
export default Main